dat_full <- preprocessing(root_dir, data_dir)
dat <- subset(dat_full, subset=RT>0 & RT<25000) # loses 2 RTs that were judged to be outliers 25978 49871
dat_borderline <- dat
dat <- perSubjectTrim.fnc(dat, response='RT', subject='Subject', trim = 2.5)$data
## ......
## n.removed = 204
## percent.removed = 2.797203
dat$RT_log <- log(dat$RT)
The main aim of this experiment was to see whether vague instructions would confer advantages over crisp alternatives when all instructions used numerals, and when there were vague and crisp versions of each of the comparison and matching strategies.
On each trial, first the referring expression that constituted the instruction for that trial was displayed (e.g., “Choose a square with about 10 dots”). Participants then pressed a key to indicate that they had read the instruction.
The instruction remained on screen, and after 1000 ms, the arrays appeared (see Figure below).Response time was measured from the presentation of the arrays until the keypress indicating the participant’s choice. The trial would timeout after 60 seconds if there was no response.
In this experiment, no feedback was given. This was because, in the vague conditions, we did not regard any response as “correct” or “incorrect”, but instead as “expected response”; “borderline response”; and “extreme response”, and we did not want to draw participants’ attention to this distinction explicitly. Which choice the participant made was recorded for analysis.
The instructions for this experiment were similar to C_exp_2, except that we changed “fewer than” to “far fewer than”: this was because “far fewer than” can have borderline cases whereas “fewer than” cannot have borderline cases.
| Item | Quantity | Selection | Crisp | Vague |
|---|---|---|---|---|
| 06:15:24 | Small | Comparison | Choose a square with fewer than 20 dots | Choose a square with far fewer than 20 dots |
| 06:15:24 | Small | Matching | Choose a square with 6 dots | Choose a square with about 10 dots |
| 06:15:24 | Large | Comparison | Choose a square with more than 10 dots | Choose a square with far more than 10 dots |
| 06:15:24 | Large | Matching | Choose a square with 24 dots | Choose a square with about 20 dots |
| 16:25:34 | Small | Comparison | Choose a square with fewer than 30 dots | Choose a square with far fewer than 30 dots |
| 16:25:34 | Small | Matching | Choose a square with 16 dots | Choose a square with about 20 dots |
| 16:25:34 | Large | Comparison | Choose a square with more than 20 dots | Choose a square with far more than 20 dots |
| 16:25:34 | Large | Matching | Choose a square with 34 dots | Choose a square with about 30 dots |
| 26:35:44 | Small | Comparison | Choose a square with fewer than 40 dots | Choose a square with far fewer than 40 dots |
| 26:35:44 | Small | Matching | Choose a square with 26 dots | Choose a square with about 30 dots |
| 26:35:44 | Large | Comparison | Choose a square with more than 30 dots | Choose a square with far more than 30 dots |
| 26:35:44 | Large | Matching | Choose a square with 44 dots | Choose a square with about 40 dots |
| 36:45:54 | Small | Comparison | Choose a square with fewer than 50 dots | Choose a square with far fewer than 50 dots |
| 36:45:54 | Small | Matching | Choose a square with 36 dots | Choose a square with about 40 dots |
| 36:45:54 | Large | Comparison | Choose a square with more than 40 dots | Choose a square with far more than 40 dots |
| 36:45:54 | Large | Matching | Choose a square with 54 dots | Choose a square with about 50 dots |
dat_plot <- summarySEwithin2(dat, measurevar="RT_log", withinvars=c("Vagueness", "Selection", "Item"), idvar="Subject")
dat$Condition <- as.factor(paste(dat$Item, dat$Vagueness))
ggplot(data=dat, mapping=aes(x=Item, y=RT_log, group=Vagueness)) +
theme_bw() + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), aspect.ratio = 1) +
facet_wrap(~Selection) +
stat_summary(mapping=aes(y=RT_log, x=Item, group=Vagueness, colour=Vagueness), fun.y=mean, geom="line", lwd=2) +
geom_smooth(mapping=aes(y=RT_log, x=Item, group=Vagueness, colour=Vagueness), method="loess")
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : pseudoinverse used at 0.985
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : neighborhood radius 2.015
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : reciprocal condition number 4.5804e-15
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : There are other near singularities as well. 4.0602
## Warning in predLoess(object$y, object$x, newx = if
## (is.null(newdata)) object$x else if (is.data.frame(newdata))
## as.matrix(model.frame(delete.response(terms(object)), : pseudoinverse used
## at 0.985
## Warning in predLoess(object$y, object$x, newx = if
## (is.null(newdata)) object$x else if (is.data.frame(newdata))
## as.matrix(model.frame(delete.response(terms(object)), : neighborhood radius
## 2.015
## Warning in predLoess(object$y, object$x, newx = if
## (is.null(newdata)) object$x else if (is.data.frame(newdata))
## as.matrix(model.frame(delete.response(terms(object)), : reciprocal
## condition number 4.5804e-15
## Warning in predLoess(object$y, object$x, newx = if
## (is.null(newdata)) object$x else if (is.data.frame(newdata))
## as.matrix(model.frame(delete.response(terms(object)), : There are other
## near singularities as well. 4.0602
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : pseudoinverse used at 4.015
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : neighborhood radius 2.015
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : reciprocal condition number 4.4845e-15
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : There are other near singularities as well. 1
## Warning in predLoess(object$y, object$x, newx = if
## (is.null(newdata)) object$x else if (is.data.frame(newdata))
## as.matrix(model.frame(delete.response(terms(object)), : pseudoinverse used
## at 4.015
## Warning in predLoess(object$y, object$x, newx = if
## (is.null(newdata)) object$x else if (is.data.frame(newdata))
## as.matrix(model.frame(delete.response(terms(object)), : neighborhood radius
## 2.015
## Warning in predLoess(object$y, object$x, newx = if
## (is.null(newdata)) object$x else if (is.data.frame(newdata))
## as.matrix(model.frame(delete.response(terms(object)), : reciprocal
## condition number 4.4845e-15
## Warning in predLoess(object$y, object$x, newx = if
## (is.null(newdata)) object$x else if (is.data.frame(newdata))
## as.matrix(model.frame(delete.response(terms(object)), : There are other
## near singularities as well. 1
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : pseudoinverse used at 0.985
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : neighborhood radius 2.015
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : reciprocal condition number 2.0732e-15
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : There are other near singularities as well. 1
## Warning in predLoess(object$y, object$x, newx = if
## (is.null(newdata)) object$x else if (is.data.frame(newdata))
## as.matrix(model.frame(delete.response(terms(object)), : pseudoinverse used
## at 0.985
## Warning in predLoess(object$y, object$x, newx = if
## (is.null(newdata)) object$x else if (is.data.frame(newdata))
## as.matrix(model.frame(delete.response(terms(object)), : neighborhood radius
## 2.015
## Warning in predLoess(object$y, object$x, newx = if
## (is.null(newdata)) object$x else if (is.data.frame(newdata))
## as.matrix(model.frame(delete.response(terms(object)), : reciprocal
## condition number 2.0732e-15
## Warning in predLoess(object$y, object$x, newx = if
## (is.null(newdata)) object$x else if (is.data.frame(newdata))
## as.matrix(model.frame(delete.response(terms(object)), : There are other
## near singularities as well. 1
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : pseudoinverse used at 4.015
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : neighborhood radius 2.015
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : reciprocal condition number 3.4466e-15
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : There are other near singularities as well. 1
## Warning in predLoess(object$y, object$x, newx = if
## (is.null(newdata)) object$x else if (is.data.frame(newdata))
## as.matrix(model.frame(delete.response(terms(object)), : pseudoinverse used
## at 4.015
## Warning in predLoess(object$y, object$x, newx = if
## (is.null(newdata)) object$x else if (is.data.frame(newdata))
## as.matrix(model.frame(delete.response(terms(object)), : neighborhood radius
## 2.015
## Warning in predLoess(object$y, object$x, newx = if
## (is.null(newdata)) object$x else if (is.data.frame(newdata))
## as.matrix(model.frame(delete.response(terms(object)), : reciprocal
## condition number 3.4466e-15
## Warning in predLoess(object$y, object$x, newx = if
## (is.null(newdata)) object$x else if (is.data.frame(newdata))
## as.matrix(model.frame(delete.response(terms(object)), : There are other
## near singularities as well. 1
We formulated the following hypotheses:
Response times were trimmed at 25,000 ms, resulting in the loss of 2 trials that were judged to have outlier RTs. The remaining data were trimmed separately for each participant at 2.5 standard deviations below and above that participant’s mean RT, leading to the loss of 204 trials (2.8% of the remaining trials). RTs in milliseconds were log-transformed so that they better approximated a normal distribution for the purposes of analysis.
dat_model <- dat
dat_model$c_Vag <- ifelse(dat_model$Vagueness=="Crisp", -0.5, 0.5)
dat_model$c_Sel <- ifelse(dat_model$Selection=="Comparison", -0.5, 0.5)
dat_model$c_Itm <- ifelse(dat_model$Item=="06:15:24", -.75, ifelse(dat_model$Item=="16:25:34", -.25, ifelse(dat_model$Item=="26:35:44", .25, .75)))
rtlmer = lmerTest::lmer(data=dat_model, RT_log ~ c_Vag * c_Sel + c_Itm + (1 + c_Vag * c_Sel + c_Itm | Subject))
pretty_coef_table(rtlmer, "rt_lmer_full_model_all_items")
| term | 𝛽 | s.e. | d.f. | 𝑡 | 𝑝 | Pr(>|t|) | sig. |
|---|---|---|---|---|---|---|---|
| c_Vag | -0.0051 | 0.014 | 36.94 | -0.37 | 7.16e-01 | 0.716 | |
| c_Sel | 0.1619 | 0.026 | 36.99 | 6.24 | 2.97e-07 | <0.001 | *** |
| c_Itm | 0.0580 | 0.018 | 36.92 | 3.23 | 2.60e-03 | <0.01 | ** |
| c_Vag:c_Sel | 0.1324 | 0.031 | 36.87 | 4.23 | 1.49e-04 | <0.001 | *** |
dat_model <- subset(dat, subset=Selection=='Comparison')
dat_model$c_Vag <- ifelse(dat_model$Vagueness=="Crisp", -0.5, 0.5)
dat_model$c_Itm <- ifelse(dat_model$Item=="06:15:24", -.75, ifelse(dat_model$Item=="16:25:34", -.25, ifelse(dat_model$Item=="26:35:44", .25, .75)))
comp_lmer <- lmerTest::lmer(data=dat_model, RT_log ~ c_Vag + c_Itm + (1 + c_Vag + c_Itm | Subject))
pretty_coef_table(comp_lmer, "rt_lmer_for_comparison_all_items")
| term | 𝛽 | s.e. | d.f. | 𝑡 | 𝑝 | Pr(>|t|) | sig. |
|---|---|---|---|---|---|---|---|
| c_Vag | -0.071 | 0.020 | 36.99 | -3.52 | 1.15e-03 | <0.01 | ** |
| c_Itm | 0.090 | 0.020 | 37.02 | 4.61 | 4.68e-05 | <0.001 | *** |
dat_model <- subset(dat, subset=Selection=='Matching')
dat_model$c_Vag <- ifelse(dat_model$Vagueness=="Crisp", -0.5, 0.5)
dat_model$c_Itm <- ifelse(dat_model$Item=="06:15:24", -.75, ifelse(dat_model$Item=="16:25:34", -.25, ifelse(dat_model$Item=="26:35:44", .25, .75)))
match_lmer <- lmerTest::lmer(data=dat_model, RT_log ~ c_Vag + c_Itm + (1 + c_Vag + c_Itm | Subject))
pretty_coef_table(match_lmer, "rt_lmer_for_matching_all_items")
| term | 𝛽 | s.e. | d.f. | 𝑡 | 𝑝 | Pr(>|t|) | sig. |
|---|---|---|---|---|---|---|---|
| c_Vag | 0.062 | 0.021 | 36.32 | 2.91 | 6.14e-03 | <0.01 | ** |
| c_Itm | 0.025 | 0.022 | 36.62 | 1.12 | 2.71e-01 | 0.271 |
Considering the first set of models:
The second set of models considered were conducted to test for main effects in the presence of interactions involving those main effects (after Levy, 2018).
Testing for a main effect of X when X is a two-level factor and the model also includes a main effect of a three-level factor and the interaction between X and Y.
Testing for a main effect of Vagueness when Vagueness is a two-level factor and the model also includes a main effect of a four-level factor Item and the interaction between Vagueness and Item.
Item.numeric <- sapply(dat$Item, function(i) contr.sum(4)[i,])
dat$Item1 <- Item.numeric[1,]
dat$Item2 <- Item.numeric[2,]
dat$Item3 <- Item.numeric[3,]
m0 <- lm(RT_log ~
Item1 + Vagueness:Item1 +
Item2 + Vagueness:Item2 +
Item3 + Vagueness:Item3 +
Selection +
Selection:Vagueness,
dat)
contrasts(dat$Item) <- contr.sum(4)
m.test <- lm(RT_log ~
Item +
Vagueness:Item1 +
Vagueness:Item2 +
Vagueness:Item3 +
Selection +
Selection:Vagueness,
dat)
m1 <- lm(RT_log ~
Item1 + Vagueness:Item1 +
Item2 + Vagueness:Item2 +
Item3 + Vagueness:Item3 +
Selection +
Selection:Vagueness +
Vagueness,
dat)
m100 <- lm(RT_log ~
Item +
Vagueness +
Item:Vagueness+
Selection+
Selection:Vagueness,
dat)
#m1 and m100 are the same model
anova(m0,m1,test="F")
## Analysis of Variance Table
##
## Model 1: RT_log ~ Item1 + Vagueness:Item1 + Item2 + Vagueness:Item2 +
## Item3 + Vagueness:Item3 + Selection + Selection:Vagueness
## Model 2: RT_log ~ Item1 + Vagueness:Item1 + Item2 + Vagueness:Item2 +
## Item3 + Vagueness:Item3 + Selection + Selection:Vagueness +
## Vagueness
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 7080 2694.5
## 2 7079 2689.7 1 4.8392 12.736 0.000361 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Item.numeric <- sapply(dat$Item, function(i) contr.sum(4)[i,])
dat$Item1 <- Item.numeric[1,]
dat$Item2 <- Item.numeric[2,]
dat$Item3 <- Item.numeric[3,]
m3 <- lm(RT_log ~
Item1 +
Item2 +
Item3 ,
dat)
contrasts(dat$Item) <- contr.sum(4)
m4 <- lm(RT_log ~
Item,
dat)
# m3 and m4 are the same model
Item.numeric <- sapply(dat$Item, function(i) contr.sum(4)[i,])
dat$Item1 <- Item.numeric[1,]
dat$Item2 <- Item.numeric[2,]
dat$Item3 <- Item.numeric[3,]
m.full <- lm(RT_log ~
Item +
Vagueness +
Selection +
Item:Vagueness +
Item:Selection +
Vagueness:Selection,
dat)
m.reduced <- lm(RT_log ~
Item1 +
Item2 +
Item3 +
Vagueness:Item1 +
Vagueness:Item2 +
Vagueness:Item3 +
Vagueness:Selection +
Selection +
Item:Selection
,dat )
anova(m.reduced, m.full, test="F")
## Analysis of Variance Table
##
## Model 1: RT_log ~ Item1 + Item2 + Item3 + Vagueness:Item1 + Vagueness:Item2 +
## Vagueness:Item3 + Vagueness:Selection + Selection + Item:Selection
## Model 2: RT_log ~ Item + Vagueness + Selection + Item:Vagueness + Item:Selection +
## Vagueness:Selection
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 7077 2686.7
## 2 7076 2681.8 1 4.8767 12.867 0.0003367 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1